//
//  DeviceInfoStreamHandler.swift
//  Pods
//
//  Created by Codex on 2025/12/06.
//
import Flutter

class DeviceInfoStreamHandler: NSObject, FlutterStreamHandler {
    var deviceInfoSink: FlutterEventSink?
    weak var plugin: TuyaHomeSdkFlutterPlugin?

    func onListen(withArguments arguments: Any?, eventSink events: @escaping FlutterEventSink) -> FlutterError? {
        deviceInfoSink = events
        return nil
    }

    func onCancel(withArguments arguments: Any?) -> FlutterError? {
        deviceInfoSink = nil
        plugin?.clearDeviceDelegates()
        return nil
    }
}
